/*
* @Author: Choisaaaa
* @Date: 2018/5/5  20:29
* 组件的组合方式1： 组件之间的嵌套使用
*/

import React from  "react";
import ReactDOM from 'react-dom';

class ES6Component extends React.Component{
    constructor(props){
        super(props);
        this.state={
            name : "Mark",
            age : 18
        }
    }
    render(){
        return (
            <div>
                <p>这里是ES6Component组件</p>
                <p>I am {this.state.name}</p>
            </div>
        );
    }
}

class ES6Component2 extends React.Component {
    render() {
        return (
            <div>
                <h1>这个是ES6Component2组件</h1>
                <hr/>
                <ES6Component />
            </div>
        );
    }
}

ReactDOM.render(
    <div>
        <ES6Component2 />
    </div>,
    document.getElementById("Study")
);